import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsEmail, IsNotEmpty, IsPhoneNumber } from "class-validator";

export class TenantDto {
  @ApiProperty({ description: "租户编码" })
  @IsNotEmpty({ message: "参数错误,租户编码不能为空." })
  tenantCode: string;

  @ApiProperty({ description: "租户名称" })
  @IsNotEmpty({ message: "参数错误,租户名不能为空." })
  tenantName: string;

  @ApiProperty({ description: "数据服务器地址" })
  @IsNotEmpty({ message: "参数错误,数据服务器地址不能为空." })
  dbHost: string;

  @ApiProperty({ description: "数据库端口号" })
  @IsNotEmpty({ message: "参数错误,数据库端口号不能为空." })
  dbPort: string;

  @ApiProperty({ description: "数据库名称" })
  @IsNotEmpty({ message: "参数错误,数据库名称不能为空." })
  dbName: string;

  @ApiProperty({ description: "数据库账号" })
  @IsNotEmpty({ message: "参数错误,数据库账号不能为空." })
  dbUsername: string;

  @ApiProperty({ description: "数据库密码" })
  @IsNotEmpty({ message: "参数错误,数据库密码不能为空." })
  dbPassword: string;

  @ApiPropertyOptional({ description: "过期时间" })
  @IsNotEmpty({ message: "参数错误,过期时间不能为空." })
  expire: Date;

  @ApiPropertyOptional({ description: "手机号" })
  // @IsPhoneNumber('CH', { message: '手机号码格式不正确' })
  phone: string;

  @ApiProperty({ description: "联系人" })
  contacts: string;

  @ApiPropertyOptional({ description: "备注" })
  remark: string;
}
